package com.sayice.design.lab3_1;

import com.sayice.design.lab3_1.builder.CarBuilder;

/**
 * @author shubing
 */
public class CarMaker {
    private CarBuilder carBuilder;
    
    public void setCarBuilder(CarBuilder carBuilder) {
        this.carBuilder = carBuilder;
    }
    
    public Car construct() {
        carBuilder.buildBody();
        carBuilder.buildEngine();
        carBuilder.buildTyre();
        carBuilder.buildGearbox();
        return carBuilder.getCar();
    }
}
